package edu.scut.course_management.po;

import com.fasterxml.jackson.annotation.JsonIgnore;

import org.springframework.security.core.GrantedAuthority;

/**
 * 持久化对象：角色
 * 
 * @author sherry
 */

public class Role implements GrantedAuthority {
    private static final long serialVersionUID = 1L;
    private Integer roleId;
    private String roleName;

    @Override
    @JsonIgnore
    public String getAuthority() {
        return this.roleName;
    }
    
    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Role(Integer roleId, String roleName) {
        this.roleId = roleId;
        this.roleName = roleName;
    }

    @Override
    public String toString() {
        return "Role {" + 
                "roleId=" + roleId + 
                ", roleName=" + roleName + 
                "}";
    }
    
    
    
}
